package bpmn.diagram.navigator;

import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

import bpmn.Association;
import bpmn.Complex;
import bpmn.DataBased;
import bpmn.End;
import bpmn.Inclusive;
import bpmn.Intermediate;
import bpmn.Parallel;
import bpmn.Process;
import bpmn.SequenceFlow;
import bpmn.Start;
import bpmn.diagram.edit.parts.AssociationEditPart;
import bpmn.diagram.edit.parts.ComplexEditPart;
import bpmn.diagram.edit.parts.DataBasedEditPart;
import bpmn.diagram.edit.parts.DataObjectEditPart;
import bpmn.diagram.edit.parts.DataObjectNameEditPart;
import bpmn.diagram.edit.parts.EndEditPart;
import bpmn.diagram.edit.parts.InclusiveEditPart;
import bpmn.diagram.edit.parts.IntermediateEditPart;
import bpmn.diagram.edit.parts.Lane2EditPart;
import bpmn.diagram.edit.parts.LaneEditPart;
import bpmn.diagram.edit.parts.LaneName2EditPart;
import bpmn.diagram.edit.parts.LaneNameEditPart;
import bpmn.diagram.edit.parts.ParallelEditPart;
import bpmn.diagram.edit.parts.PoolEditPart;
import bpmn.diagram.edit.parts.Process2EditPart;
import bpmn.diagram.edit.parts.ProcessEditPart;
import bpmn.diagram.edit.parts.ProcessNameEditPart;
import bpmn.diagram.edit.parts.SequenceFlowEditPart;
import bpmn.diagram.edit.parts.StartEditPart;
import bpmn.diagram.edit.parts.Task2EditPart;
import bpmn.diagram.edit.parts.Task3EditPart;
import bpmn.diagram.edit.parts.Task4EditPart;
import bpmn.diagram.edit.parts.Task5EditPart;
import bpmn.diagram.edit.parts.Task6EditPart;
import bpmn.diagram.edit.parts.Task7EditPart;
import bpmn.diagram.edit.parts.Task8EditPart;
import bpmn.diagram.edit.parts.Task9EditPart;
import bpmn.diagram.edit.parts.TaskEditPart;
import bpmn.diagram.edit.parts.TaskName2EditPart;
import bpmn.diagram.edit.parts.TaskName3EditPart;
import bpmn.diagram.edit.parts.TaskName4EditPart;
import bpmn.diagram.edit.parts.TaskName5EditPart;
import bpmn.diagram.edit.parts.TaskName6EditPart;
import bpmn.diagram.edit.parts.TaskName7EditPart;
import bpmn.diagram.edit.parts.TaskName8EditPart;
import bpmn.diagram.edit.parts.TaskName9EditPart;
import bpmn.diagram.edit.parts.TaskNameEditPart;
import bpmn.diagram.edit.parts.WrappingLabelEditPart;
import bpmn.diagram.part.Bpmn_1_1DiagramEditorPlugin;
import bpmn.diagram.part.Bpmn_1_1VisualIDRegistry;
import bpmn.diagram.providers.Bpmn_1_1ElementTypes;
import bpmn.diagram.providers.Bpmn_1_1ParserProvider;

/**
 * @generated
 */
public class Bpmn_1_1NavigatorLabelProvider extends LabelProvider implements
		ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		Bpmn_1_1DiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		Bpmn_1_1DiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof Bpmn_1_1NavigatorItem
				&& !isOwnView(((Bpmn_1_1NavigatorItem) element).getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof Bpmn_1_1NavigatorGroup) {
			Bpmn_1_1NavigatorGroup group = (Bpmn_1_1NavigatorGroup) element;
			return Bpmn_1_1DiagramEditorPlugin.getInstance().getBundledImage(
					group.getIcon());
		}

		if (element instanceof Bpmn_1_1NavigatorItem) {
			Bpmn_1_1NavigatorItem navigatorItem = (Bpmn_1_1NavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (Bpmn_1_1VisualIDRegistry.getVisualID(view)) {
		case DataObjectEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?DataObject", Bpmn_1_1ElementTypes.DataObject_3006); //$NON-NLS-1$
		case TaskEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3002); //$NON-NLS-1$
		case Task7EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3018); //$NON-NLS-1$
		case LaneEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Lane", Bpmn_1_1ElementTypes.Lane_3007); //$NON-NLS-1$
		case IntermediateEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Intermediate", Bpmn_1_1ElementTypes.Intermediate_3004); //$NON-NLS-1$
		case StartEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Start", Bpmn_1_1ElementTypes.Start_3003); //$NON-NLS-1$
		case Task3EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3014); //$NON-NLS-1$
		case PoolEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://esi.uclm.es/metamodels/bpmn?Pool", Bpmn_1_1ElementTypes.Pool_2003); //$NON-NLS-1$
		case Task5EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3016); //$NON-NLS-1$
		case Lane2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Lane", Bpmn_1_1ElementTypes.Lane_3008); //$NON-NLS-1$
		case Task6EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3017); //$NON-NLS-1$
		case InclusiveEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Inclusive", Bpmn_1_1ElementTypes.Inclusive_3010); //$NON-NLS-1$
		case ParallelEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Parallel", Bpmn_1_1ElementTypes.Parallel_3012); //$NON-NLS-1$
		case ComplexEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Complex", Bpmn_1_1ElementTypes.Complex_3011); //$NON-NLS-1$
		case DataBasedEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?DataBased", Bpmn_1_1ElementTypes.DataBased_3013); //$NON-NLS-1$
		case Process2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Process", Bpmn_1_1ElementTypes.Process_3001); //$NON-NLS-1$
		case ProcessEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://esi.uclm.es/metamodels/bpmn?Process", Bpmn_1_1ElementTypes.Process_1000); //$NON-NLS-1$
		case Task9EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3020); //$NON-NLS-1$
		case Task8EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3019); //$NON-NLS-1$
		case EndEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?End", Bpmn_1_1ElementTypes.End_3005); //$NON-NLS-1$
		case AssociationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://esi.uclm.es/metamodels/bpmn?Association", Bpmn_1_1ElementTypes.Association_4002); //$NON-NLS-1$
		case Task2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3009); //$NON-NLS-1$
		case SequenceFlowEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://esi.uclm.es/metamodels/bpmn?SequenceFlow", Bpmn_1_1ElementTypes.SequenceFlow_4001); //$NON-NLS-1$
		case Task4EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://esi.uclm.es/metamodels/bpmn?Task", Bpmn_1_1ElementTypes.Task_3015); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = Bpmn_1_1DiagramEditorPlugin.getInstance()
				.getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null && elementType != null
				&& Bpmn_1_1ElementTypes.isKnownElementType(elementType)) {
			image = Bpmn_1_1ElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof Bpmn_1_1NavigatorGroup) {
			Bpmn_1_1NavigatorGroup group = (Bpmn_1_1NavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof Bpmn_1_1NavigatorItem) {
			Bpmn_1_1NavigatorItem navigatorItem = (Bpmn_1_1NavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (Bpmn_1_1VisualIDRegistry.getVisualID(view)) {
		case DataObjectEditPart.VISUAL_ID:
			return getDataObject_3006Text(view);
		case TaskEditPart.VISUAL_ID:
			return getTask_3002Text(view);
		case Task7EditPart.VISUAL_ID:
			return getTask_3018Text(view);
		case LaneEditPart.VISUAL_ID:
			return getLane_3007Text(view);
		case IntermediateEditPart.VISUAL_ID:
			return getIntermediate_3004Text(view);
		case StartEditPart.VISUAL_ID:
			return getStart_3003Text(view);
		case Task3EditPart.VISUAL_ID:
			return getTask_3014Text(view);
		case PoolEditPart.VISUAL_ID:
			return getPool_2003Text(view);
		case Task5EditPart.VISUAL_ID:
			return getTask_3016Text(view);
		case Lane2EditPart.VISUAL_ID:
			return getLane_3008Text(view);
		case Task6EditPart.VISUAL_ID:
			return getTask_3017Text(view);
		case InclusiveEditPart.VISUAL_ID:
			return getInclusive_3010Text(view);
		case ParallelEditPart.VISUAL_ID:
			return getParallel_3012Text(view);
		case ComplexEditPart.VISUAL_ID:
			return getComplex_3011Text(view);
		case DataBasedEditPart.VISUAL_ID:
			return getDataBased_3013Text(view);
		case Process2EditPart.VISUAL_ID:
			return getProcess_3001Text(view);
		case ProcessEditPart.VISUAL_ID:
			return getProcess_1000Text(view);
		case Task9EditPart.VISUAL_ID:
			return getTask_3020Text(view);
		case Task8EditPart.VISUAL_ID:
			return getTask_3019Text(view);
		case EndEditPart.VISUAL_ID:
			return getEnd_3005Text(view);
		case AssociationEditPart.VISUAL_ID:
			return getAssociation_4002Text(view);
		case Task2EditPart.VISUAL_ID:
			return getTask_3009Text(view);
		case SequenceFlowEditPart.VISUAL_ID:
			return getSequenceFlow_4001Text(view);
		case Task4EditPart.VISUAL_ID:
			return getTask_3015Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getDataObject_3006Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.DataObject_3006,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry
						.getType(DataObjectNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5007); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3002Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3002,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5003); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3018Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3018,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName7EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5017); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getLane_3007Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Lane_3007,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(LaneNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5009); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getIntermediate_3004Text(View view) {
		Intermediate domainModelElement = (Intermediate) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3004); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getStart_3003Text(View view) {
		Start domainModelElement = (Start) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3003); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3014Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3014,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName3EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPool_2003Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Pool_2003,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry
						.getType(WrappingLabelEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5010); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3016Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3016,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName5EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5015); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getLane_3008Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Lane_3008,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(LaneName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5008); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3017Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3017,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName6EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5016); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getInclusive_3010Text(View view) {
		Inclusive domainModelElement = (Inclusive) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3010); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getParallel_3012Text(View view) {
		Parallel domainModelElement = (Parallel) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3012); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComplex_3011Text(View view) {
		Complex domainModelElement = (Complex) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3011); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getDataBased_3013Text(View view) {
		DataBased domainModelElement = (DataBased) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getProcess_3001Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider
				.getParser(Bpmn_1_1ElementTypes.Process_3001,
						view.getElement() != null ? view.getElement() : view,
						Bpmn_1_1VisualIDRegistry
								.getType(ProcessNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5012); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getProcess_1000Text(View view) {
		Process domainModelElement = (Process) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 1000); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3020Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3020,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName9EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5019); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3019Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3019,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName8EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getEnd_3005Text(View view) {
		End domainModelElement = (End) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3005); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getAssociation_4002Text(View view) {
		Association domainModelElement = (Association) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 4002); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3009Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3009,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5011); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getSequenceFlow_4001Text(View view) {
		SequenceFlow domainModelElement = (SequenceFlow) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 4001); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getTask_3015Text(View view) {
		IParser parser = Bpmn_1_1ParserProvider.getParser(
				Bpmn_1_1ElementTypes.Task_3015,
				view.getElement() != null ? view.getElement() : view,
				Bpmn_1_1VisualIDRegistry.getType(TaskName4EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			Bpmn_1_1DiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5014); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return ProcessEditPart.MODEL_ID.equals(Bpmn_1_1VisualIDRegistry
				.getModelID(view));
	}

}
